package array01;

public class BookTest {
    private static int booklistLength = 3;

    public static void main(String[] args) {

        Books[] myBooks = new Books[booklistLength];
        System.out.println(myBooks[2]);


        myBooks[0] = new Books();
        myBooks[1] = new Books();
        myBooks[2] = new Books();

        myBooks[0].title = "The Grapes of Java";
        myBooks[1].title = "The Java Gatsby";
        myBooks[2].title = "The Java Cookbook";

        myBooks[0].author = "bob";
        myBooks[1].author = "sue";
        myBooks[2].author = "ian";

        for (int i = 0; i < booklistLength; i++) {
            System.out.print(myBooks[i].title);
            System.out.print(" by ");
            System.out.println(myBooks[i].author);
        }
    }

}

class Books {
    public String title;
    public String author;
    public static String cover = "corsdfasdfasdf";
    public static String cover2 = "corasdfasdf";
    public static String cover3 = "coasdfasdfr";

}